home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / games1 / mjsolv12.zip / MJSOLVER.DOC next >
Text File  |  1993-03-03  |  19KB  |  357 lines

  1.  
  2.  
  3.                                 MJSOLVER v1.2
  4.                    Copyright (C) 1990, 1991 by Ken McDonald
  5.  
  6.  
  7.  
  8.         ---------------------- What Is MJSolver? ----------------------
  9.  
  10.            MJSolver is designed for use with  Mah Jongg  version 3.3 or
  11.         later, (C) by Nels Anderson.  It's basic function is to rapidly
  12.         test any of the  65536  Mah Jongg  boards for the best possible
  13.         score through a series of simulated plays.
  14.  
  15.            MJSolver does not  incorporate built-in  hueristics or an AI
  16.         inference  engine to conquer every  mahjongg board encountered.
  17.         The main  goal of  MJSolver is  to give some indication  of the
  18.         degree of difficulty of one  board relative to another.  It can
  19.         also  be used to  determine whether a  board can be won, and to
  20.         show the  winning  series of moves by autoplaying them with Mah
  21.         Jongg. This might be helpful in understanding how a particular-
  22.         ly difficult board can be solved. The conquering is left to the
  23.         Mah Jongg player.  After all, that's the real point of playing,
  24.         right?
  25.  
  26.            The method employed by MJSolver during the simulation trials
  27.         consists of  random  selection and  removal of tile pairs, with
  28.         equal  weight given to  all valid moves.  The  results for each
  29.         simulation are tracked so that the statistics for any number of
  30.         simulations can be determined upon completion. As with any ran-
  31.         dom  sampling technique, the  accuracy of the statistics  for a
  32.         particular board will improve as the number of simulations per-
  33.         formed increases.  The sequence of moves  resulting in the best
  34.         score during the simulation  process is saved in memory so that
  35.         the  move info can be  passed on to Mah Jongg for  autoplay, or
  36.         saved to a disk file for later retreival and playback.
  37.  
  38.            The random  method employed produces a good  indicator as to
  39.         the degree of difficulty of any board, but is not a very strong
  40.         technique with regard to winning the board. The reason for this
  41.         lies in the fact that their are  a vast number of possible move
  42.         paths that can be taken for each board. If, for example, at any
  43.         given move juncture there are on average 8 possible moves,  and
  44.         40 moves can be played per game on average,  then the number of
  45.         different  possible move  paths would  be  8 raised to the 40th
  46.         power,  or roughly 1 with 36 zeros  after it.  If only a few of
  47.         these paths lead to winning the board,  an awful lot of simula-
  48.         tions will have to be run to ferret them out. Luckily, a signi-
  49.         ficant percentage of most of the board's move paths result in a
  50.         winning sequnce of moves.(Approximately 83% of the 65536 boards
  51.         can be won after 2000 simulations!).
  52.  
  53.            After a person plays Mah Jongg for a while he begins to dev-
  54.         elop  certain strategies based on his past  playing experience.
  55.         Therefore,  there will be cases when MJSolver  shows a board to
  56.         be winnable 50%  of the time but it takes you 5 tries to win it
  57.         manually.  Of course, the reverse will also occur.  This is be-
  58.         cause  your strategy  has biased the  probabilty of winning one
  59.         way or the other relative to the random play statistics.
  60.  
  61.  
  62.  
  63.  
  64.         --------------- Shareware Notice and Disclaimer ---------------
  65.  
  66.            MJSOLV12 is hereby released as shareware.  If you enjoy this
  67.         product and decide to keep  using it, please send the suggested
  68.         registration  price of $5.00 (in U.S. funds only, please) to me
  69.         at the address found at the end of this document. A copy of the
  70.         latest  version of the  software, with your name as  registered
  71.         user in the title page,  will be sent upon receipt of the above
  72.         registration fee.  See MJSOLVER.ORD for more  details on how to
  73.         order.
  74.  
  75.            You may freely distribute MJSOLV12 (and are even  encouraged
  76.         to do so) provided that the following files are included intact
  77.         and in an unedited form within the archived package:
  78.  
  79.                    MJSOLVER.EXE - the main MJSolver program
  80.                    MJSOLVER.DOC - this document
  81.                    MJSOLVER.HIS - a history of program improvements
  82.                    MJSOLVER.ORD - a printer ready order form
  83.                    SETUP.MJS    - a default MJSolver Setup File
  84.  
  85.  
  86.            The archiving method may be changed as necessary, however no
  87.         other alterations, additions or deletions are authorized.
  88.  
  89.            While MJSOLV12 is designed for use with Mah Jongg, it is not
  90.         to be  considered as part of the Mah Jongg program, and may not
  91.         be bundled with this, or any other software package without the
  92.         express permission of the author.
  93.  
  94.            This  software is  released in as is condition.  Although it
  95.         has been tested on several  different hardware  configurations,
  96.         there  is simply no way  to guarantee it's  performance or com-
  97.         patibility on  every possible setup.  The author will therefore
  98.         accept  no responsibility nor liability for  any damage arising
  99.         from  it's use or  distribution  and  does hereby  disclaim any
  100.         warranties, either implied or expressed.
  101.  
  102.  
  103.  
  104.  
  105.         ------------------------ What It Does -------------------------
  106.  
  107.            How many times have you started a Mah Jongg game only to run
  108.         out of plays after removing only 20 or 30 tiles?  How about all
  109.         those games that have ended with only 2 (or 4, or 16) tiles re-
  110.         maining?  Have you ever wondered how many of these boards could
  111.         actually be completed? Now MJSolver can help you finish some of
  112.         the boards that you might otherwise have given up on!
  113.  
  114.            MJSolver  will rapidly run as many as  65535 simulated plays
  115.         on any selected board, while presenting a running tally of it's
  116.         progress. After running the simulations, you may decide to play
  117.         the board  yourself or, if you'd rather, allow MJSolver to show
  118.         you the best solution that it came up with.
  119.  
  120.  
  121.  
  122.  
  123.         ----------------------- Using MJSolver ------------------------
  124.  
  125.            MJSolver may  be run on  either a floppy or hard drive based
  126.         system.  Additional disk storage  space may be required for the
  127.         following reasons:
  128.  
  129.              1.  It is desired to save solved board move sequences.
  130.  
  131.              2.  A custom setup file is created and saved to disk.
  132.  
  133.              3.  An alternate Mah Jongg statistics file name is
  134.                  specified.
  135.  
  136.            See the  "defaults"  information below, as well as the "Menu
  137.         Options" selection for details.
  138.  
  139.            To start  MJSolver, simply type  "MJSOLVER <CR>"  at the DOS
  140.         prompt.  There  are a number of valid parameters which may also
  141.         be entered at this time, which are detailed below.   Any or all
  142.         of these parameters may be passed to  MJSolver from the command
  143.         line or a batch file. To see a list of all parameters, type the
  144.         following from the DOS prompt: MJSOLVER ? <CR>
  145.  
  146.         Note:  The symbol  "<CR>" is used in this document to signify a
  147.                carriage return.
  148.  
  149.            You  will then  see an  example  of the  syntax as well as a
  150.         brief explanation of the type of  information  MJSolver expects
  151.         for each parameter. As indicated above, use of these parameters
  152.         is optional. If any of this information is omitted, or if there
  153.         is anything included that  MJSolver doesn't understand, certain
  154.         defaults will be used as explained below.
  155.  
  156.  
  157.  
  158.  
  159.         ------------------- Command Line Parameters -------------------
  160.  
  161.  
  162.         PARA-  |                                             |
  163.         METER  |             EXPLATION/EXAMPLES              |  DEFAULT
  164.         -------+---------------------------------------------+---------
  165.         -bx    | Specifies the board  number you  would like |   RANDOM
  166.                | MJSolver to test.  Valid arguments  for "x" |   NUMBER
  167.                | are any number from 0 to 65535, inclusive.  |
  168.                |                                             |
  169.                | EXAMPLE: -b37847                            |
  170.         -------+---------------------------------------------+---------
  171.         PARA-  |                                             |
  172.         METER  |             EXPLATION/EXAMPLES              |  DEFAULT
  173.         -------+---------------------------------------------+---------
  174.         -sfx   | Name of MJSolver setup file to load.        |    SETUP
  175.                |                                             |
  176.                | EXAMPLE: -sfSETUP2                          |
  177.         -------+---------------------------------------------+---------
  178.         -sx    | The number of simulations  you wish to run. |     1000
  179.                | Enter any value  from 1 to 65535  for  "x". |
  180.                |                                             |
  181.                | EXAMPLE: -s25000                            |
  182.         -------+---------------------------------------------+---------
  183.         -pax   | Tells MJSolver where  Mah Jongg is located. |     none
  184.                | This may be  needed if the Mah Jongg  files |
  185.                | are in a different drive  and/or  directory |
  186.                | than that which MJSolver was run from.      |
  187.                |                                             |
  188.                | Note:  MJSolver  will  automatically search |
  189.                | the current  directory, all  directories in |
  190.                | your PATH, and the directory that  MJSolver |
  191.                | itself resides in for MAHJONGG.EXE.         |
  192.                |                                             |
  193.                | EXAMPLE: -paC:\GAMES\MAHJONGG               |
  194.         -------+---------------------------------------------+---------
  195.         -px    | Insert up to a 5 second delay between moves |        1
  196.                | in the (A)uto Play feature.  Enter any num- |
  197.                | ber from 0 to 5000, in milliseconds.        |
  198.                |                                             |
  199.                | EXAMPLE: -p2000                             |
  200.         -------+---------------------------------------------+---------
  201.  
  202.  
  203.  
  204.  
  205.         -------+---------------------------------------------+---------
  206.         -q     | During the simulations,  MJSolver will beep |  BEEP ON
  207.                | upon finding a  winning sequence of  moves. |
  208.                | Using the "-q" parameter will  suppress the |
  209.                | beep, running MJSolver in "quiet" mode.     |
  210.         -------+---------------------------------------------+---------
  211.         <mjs>  | Any non-standard  settings you wish to pass |      n/a
  212.                | to MAHJONGG.EXE should also be included, if |
  213.                | the  board is to be  played  following  the |
  214.                | simulations.  In  general,  any options you |
  215.                | would normally specify (either from the DOS |
  216.                | prompt or via  a batch file)  when starting |
  217.                | Mah Jongg should also be entered here.      |
  218.                |                                             |
  219.                | EXAMPLE:  -n -y -uWB                        |
  220.         -------+---------------------------------------------+---------
  221.  
  222.            Any optional  information you pass  to MJSolver is processed
  223.         in the same order entered. If you intend to override any of the
  224.         information contained in the setup file, you will need to enter
  225.         these items after the "-sfx" parameter (if used) on the command
  226.         line. No other order of entry is necessary.
  227.  
  228.  
  229.  
  230.  
  231.         -------------------- The MJSolver Display ---------------------
  232.  
  233.            Once MJSolver is running,  a title screen  will be displayed
  234.         containing copywrite and  registration information. Hit any key
  235.         to go directly to the main screen and begin the simulations.
  236.  
  237.            On this screen you  will see all data  pertaining to or gen-
  238.         erated from the  simulations:  the board number currently being
  239.         tested; the number of simulations completed; the score for  the
  240.         last test performed; the  best and worst scores  encountered so
  241.         far; and the average score of all simulations completed on this
  242.         board.  At the bottom of the screen is a message bar indicating
  243.         the number of simulations to be  performed,  and the option  to
  244.         "Press `Q' to Quit". If you decide not to complete the full set
  245.         of simulations, you may halt the program at any time by hitting
  246.         either "Q" or <ESC>. Testing may be resumed by hitting <CR>.
  247.  
  248.  
  249.  
  250.  
  251.         ------------------------ Menu Options -------------------------
  252.  
  253.            Once finished with the simulations,  the message bar will be
  254.         replaced with a menu offering  the options listed below. Typing
  255.         the highlighted letter selects that option. <ESC> will cancel.
  256.  
  257.         Next -  Allows you to run simulations on the next, or any other
  258.                 board. Typing "N" will display the next  board  number.
  259.                 You may edit the number displayed or hit <ESC> to clear
  260.                 the entry field and then type in a new number. Hit <CR>
  261.                 to accept the board and begin simulations.
  262.  
  263.         Play -  Offers the options for playing the board following sim-
  264.                 ulations. Select "Manual" for normal gameplay or "Auto"
  265.                 to have MJSolver show you the best solution  arrived at
  266.                 during simulations.  If a winning sequence of moves was
  267.                 found during  simulations, the final tile pair will not
  268.                 be removed by MJSolver in  Auto-play mode.  The purpose
  269.                 of this  is to allow you to replace  tiles and manually
  270.                 play from any point you may choose.
  271.  
  272.         Setup - Allows editing of the active configuration or any saved
  273.                 setup file loaded from the "File" sub-menu. The <PgUp>,
  274.                 <PgDn> or <CR> keys can be used to move between fields.
  275.                 No  actual editing of the text is needed for any option
  276.                 which shows the up/down arrow. You may toggle among the
  277.                 legal values  for these settings  using the up and down
  278.                 cursor keys. All others are to be edited as text, using
  279.                 insert mode only. Certain of these strings may be long-
  280.                 er than their entry fields. The text may be scrolled to
  281.                 the left or right while editing, with an arrow shown to
  282.                 indicate the direction in which any overrun exists.
  283.  
  284.                 Note:  Any setup changes made will be in effect for the
  285.                 current session only, unless saved to disk as described
  286.                 below. A default file called  'setup'  is automatically
  287.                 loaded at program  startup, but must be manually  saved
  288.                 upon program termination for changes to be permanent.
  289.  
  290.         File -  Accesses the sub-menu from  which any Settings or Board
  291.                 file  may  be loaded or saved to disk. A  default file-
  292.                 name will be supplied in either case. For a Board file,
  293.                 the form "bd_xxxxx"  is used,  where "xxxxx"  is a five
  294.                 digit  representation of the board number.  The default
  295.                 for a Settings file is "setup".  You may edit either of
  296.                 the supplied  filenames or hit <ESC> to clear the field
  297.                 and then enter one of your own choice.  If <ESC> is hit
  298.                 twice in succession, you will be returned to the main
  299.                 menu with the file string intact.
  300.  
  301.                 Note:  It is not necessary to include an extension when
  302.                 entering a filename. MJSolver automatically adds ".MJS"
  303.                 for Settings files, and ".MJB" for Board files.
  304.  
  305.  
  306.  
  307.  
  308.         Exit -  Quits MJSolver and exits to DOS.  (All other selections
  309.                 return you to the "options" screen upon completion.)
  310.  
  311.         F10  -  Boss  Mode,  shells out to DOS.  No indication is given
  312.                 that the shell was  spawned from MJSolver so  make sure
  313.                 to type exit to  return to MJSolver or you will run out
  314.                 of memory.
  315.  
  316.         <CR> -  Restarts simulations  on the same board,  adding to the
  317.                 statistics from the previous run,  even after the board
  318.                 has been manually or automatically played.  Useful if a
  319.                 winning board has not been  found after the first round
  320.                 of simulating.
  321.  
  322.  
  323.  
  324.  
  325.         --------------------- The STATISTICS File ---------------------
  326.  
  327.            MJSolver will tell  Mah Jongg  to save statistics  generated
  328.         from games played through MJSolver to a file named MJSOLVER.STA
  329.         located in the same directory as Maj Jongg. The purpose of this
  330.         is to keep from "padding" your Maj Jongg statistics file (e.g.-
  331.         MAHSTATS) with info generated by MJSolver.  This default can be
  332.         overridden by  changing the statistics  file name in  the Setup
  333.         menu.  It can also be changed by  using the "-fn"  parameter on
  334.         MJSolver's command line.  (e.g "-f/mahstats")  See MAHJONGG.DOC
  335.         for more info.
  336.  
  337.         
  338.  
  339.  
  340.         -------------------- Registering MJSolver ---------------------
  341.  
  342.            I certainly hope  that you enjoy using this product and that
  343.         it proves  to be a valuable utility. If so, the $5.00 suggested
  344.         registration fee would  be much appreciated  and would  provide
  345.         encouragement to further refine and improve this product.
  346.  
  347.            Please include any comments and/or suggestions and mail to:
  348.  
  349.                           Ken McDonald
  350.                           P.O. Box 654
  351.                           Walled Lake, MI  48390-0654
  352.  
  353.            I may also be reached by calling LIBERTY BBS in Mt. Clemens,
  354.         Michigan at (313) 792-4911 (300/1200/2400 baud - N81). Any cor-
  355.         respondence  should be addressed to  Cap'n Smith,  user #7, and
  356.         will be forwarded to me.
  357.